import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
import jdk.nashorn.internal.objects.Global;

import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Home-pc
 * Date: 2023-08-15
 * Time: 9:12
 */
public class August15th {
    private String name;
    private int age;
    private static String classRoom;
    {
        this.name="zhangsan";
        this.age=12;
        System.out.println("这里是构造块");
    }
    static {
        classRoom="999";
        System.out.println("这里是静态块1");
    }
    static {
        classRoom="1";
        System.out.println("这里是静态块2");
    }
    public August15th(){
        System.out.println("这里是不带参的构造方法");
    }
    public void show(){
        System.out.println(this.name+" "+this.age);
    }
    public static void main(String[] args) {
        August15th student1=new August15th();
        System.out.println("++++++++++++++++++++");
        August15th student2=new August15th();
    }
}

class Person{
    private String name;
    private int age;
    public Person(String name,int age){
        this.name=name;
        this.age=age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public static void main(String[] args) {
        Person person=new Person("zhangsan",12);
        System.out.println(person);

    }
}


class Animal{
    public String name;
    public int age;
    public Animal(){
        this.name="zhangdan";
        this.age=12;
    }
    public void eat(){
        System.out.println(this.name+"吃饭");
    }
}
class Dog extends Animal{
    public void bark(){
        System.out.println(name+"汪汪");
    }
}
class Cat extends Animal{
    public void mimi(){
        System.out.println(name+"喵喵");
    }
}

class TestExtends{
    public static void main(String[] args) {
        Dog dog=new Dog();
        System.out.println(dog.name);
        dog.eat();
    }
}

/*class Base{
    int a;
    int b;
    int c;
    public Base(){
        this.a=100;
        this.b=6789;
        this.c=89;
    }
}
class Der extends Base{
    int c;
    public  void method(){
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);
        System.out.println(d);
    }
}

class Test2{
    public static void main(String[] args) {
        Der der=new Der();
        der.method();
    }
}*/


/*class Base{
    public int a;
    int b;
    public Base(){
        this.a=100;
        this.b=6789;
    }
    public void methodA(){
        System.out.println("父类中的方法A");
    }
}
class Der extends Base{
    int a;
    int b;
    public void methodA(){
        System.out.println("子类中的方法A");
    }
    public  void method(){
        System.out.println(a);
        System.out.println(b);
        methodA();
    }

    public static void main(String[] args) {
        Der der=new Der();
        der.method();

    }
}*/


 class Base{
    public Base(){
        System.out.println("这是父类的构造方法");
    }
    {
        System.out.println("这是父类的构造块");
    }
    static {
        System.out.println("这是父类的静态代码块");
    }
}
class Der extends Base{
    public Der(){
        System.out.println("这是子类的构造方法");
    }
    {
        System.out.println("这是子类的构造块");
    }
    static {
        System.out.println("这是子类的静态代码块");
    }
}
class  Test{
    public static void main(String[] args) {
        Der der=new Der();
        System.out.println("++++++++++++++++++++++++++++++++++");
        Der der1=new Der();
    }
}



class Tire{

}
class Engine{

}
class System{

    public static Global out;
}
class Car{
    private Tire tire;
    private Engine engine;
    private System system;
}
class Benz extends Car{

}
